package cn.ljy.uem.web.action.backstage.school;

import cn.ljy.authority.web.controller.backstage.BaseBackstageController;
import cn.ljy.common.annotation.LimitRequest;
import cn.ljy.common.model.result.ResponseData;
import cn.ljy.uem.model.SchoolCourse;
import cn.ljy.uem.model.query.SchoolCourseQuery;
import cn.ljy.uem.service.SchoolCourseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;


/**
 * 学校课程控制器
 *
 * @author 小锋
 * @date 2022/07/26
 */
@Api(tags = "后台的课程模块")
@RestController
@RequestMapping(value = "/api/backstage/school/schoolCourse")
public class SchoolCourseController extends BaseBackstageController<SchoolCourse, SchoolCourseQuery, Integer> {

    @Autowired
    private SchoolCourseService baseService;

    @ApiOperation(value = "查询所有课程")
    @GetMapping("/all")
    @Override
    protected ResponseData query(SchoolCourseQuery query) {
        return super.query(query);
    }


    @ApiOperation(value = "读取课程信息")
    @Override
    protected ResponseData get(@PathVariable("id") Integer id) {
        return super.get(id);
    }

    @ApiOperation(value = "删除课程(移入回收站)")
    @Override
    protected ResponseData deletes(@NotEmpty(message = "操作失败：请选择要移除的记录") Integer[] ids) {
        return super.deletes(ids);
    }

    @ApiOperation(value = "添加课程")
    @Override
    protected ResponseData add(@Valid @RequestBody SchoolCourse schoolCourse) {
        return super.add(schoolCourse);
    }

    @ApiOperation(value = "编辑课程")
    @Override
    protected ResponseData edit(@Valid @RequestBody SchoolCourse schoolCourse) {
        return super.edit(schoolCourse);
    }


}
